package com.txsj.scan.bean;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Unique;
import org.greenrobot.greendao.annotation.Generated;

/**
 * @Created by WangChuangJun on 2018/11/28
 * @Describe 记录本地缓存的加载记录
 *  1.  先对比type : EpcGoodsInfo   2:EpcInfo    3:GoodsInfo 哪一种缓存
 *  2.  (1)    如果 type==1||type==2
 *             接下来判断 update_time >= 1000 * 60 * 60 * 2
 *             那就更新这两个缓存
 *             更新成功后再把对应type下的update_time更新一下
 *      (2)    如果 type==3
 *              接下来判断warehouse_id == null,如果为空说明是第一次直接请求网络进行缓存，并添加warehouse_id并更新当前时间update_time
 *              如果warehouse_id != null,再判断update_time >= 1000*60*60*2,那就更新缓存并更新时间update_time
 */
@Entity
public class RecordInfo {
    private int type; //1:EpcGoodsInfo   2:EpcInfo    3:GoodsInfo
    @Unique
    private String  warehouse_id;//仓库id
    private long update_time;//更新过的时间
    @Generated(hash = 96856870)
    public RecordInfo(int type, String warehouse_id, long update_time) {
        this.type = type;
        this.warehouse_id = warehouse_id;
        this.update_time = update_time;
    }
    @Generated(hash = 1863816245)
    public RecordInfo() {
    }
    public int getType() {
        return this.type;
    }
    public void setType(int type) {
        this.type = type;
    }
    public String getWarehouse_id() {
        return this.warehouse_id;
    }
    public void setWarehouse_id(String warehouse_id) {
        this.warehouse_id = warehouse_id;
    }
    public long getUpdate_time() {
        return this.update_time;
    }
    public void setUpdate_time(long update_time) {
        this.update_time = update_time;
    }

}
